<?php
/**
 * MyBB 1.6
 * Copyright 2010 MyBB Group, All Rights Reserved
 *
 * Website: http://mybb.com
 * License: http://mybb.com/about/license
 *
 * $Id: mod.php 5380 2011-02-21 12:04:43Z Otse $
 */
 
// Disallow direct access to this file for security reasons
if(!defined("IN_MYBB"))
{
	die("Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined.");
}

//$plugins->add_hook("index_start", "head_index_start");


function head_info()
{
    return array(
	"name"			=> "Head",
	"description"	=> "Changes the header for Scrolls purposes. Don't want to manually touch up revertables.",
	"website"		=> "http://ak.fm",
	"author"		=> "Steelrat",
	"authorsite"	=> "http://ak.fm",
	"version"		=> "0.9",
	"guid" 			=> "",
	"compatibility" => "*"
    );

}

/*
function head_install()
{
    // We're not really installable at al so we use activators.
}
*/
/*
function head_uninstall()
{
    // ;}
}*/

function head_is_installed()
{
    global $db;

    return true;
}

function head_activate()
{
    require "../inc/adminfunctions_templates.php";
    
    //find_replace_templatesets("header", "#".preg_quote('<div class="logo">').'#i', "");
    find_replace_templatesets("header", "#".preg_quote('<img src="{$theme[\'logo\']}" alt="{$mybb->settings[\'bbname\']}" title="{$mybb->settings[\'bbname\']}" />')."#i", '<img alt="" src="" />');
}


function head_deactivate()
{
    require "../inc/adminfunctions_templates.php";
    find_replace_templatesets("header", "#".preg_quote('<img alt="" src="" />')."#i", '<img src="{$theme[\'logo\']}" alt="{$mybb->settings[\'bbname\']}" title="{$mybb->settings[\'bbname\']}" />', 0);
}
